package com.qf.config;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.config
 * @Description:
 * @Date 2022/10/1 15:06
 */
public class MyIntertceptor01 implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println(request.getRequestURI());
//       处理器
        System.out.println(handler);

        System.out.println("pre过滤器111:执行处理器前");
//        是否放行
        return true;
    }

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        System.out.println("post过滤器111：执行返回值前");

    }

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        System.out.println("after过滤器111：处理器完全执行后");

    }
}
